<?php
/**
 * Класс-генератор URL адреса для записи
 *
 * @package default
 * @author Alexander Sibiryakov
 **/
class UrlGenItem implements UrlGen
{
	private $ugt;
	public function __construct(UrlGenThing $ugt) {
		$this->ugt = $ugt;
	}
	
	public function genUrl(Array $params) {		
		$ug = new RL_URLGenerator($this->ugt->router->getRule("showitem")); 
		$ug->setRouter($this->ugt->router);
		$ug->setParams(array(
			"community_url"=>$this->ugt->getCommunityUrl($params[0]),
			"id_item"=>$params[1]
		));
		return $ug->generateUrl();
	}
	
} // END class 